# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>

pkgname=folks
pkgver=0.15.6
pkgrel=1
pkgdesc="Library to aggregates people into metacontacts"
url="https://wiki.gnome.org/Projects/Folks"
arch=(x86_64)
license=(LGPL)
depends=(
  evolution-data-server
  libgee
  libxml2
)
makedepends=(
  git
  gobject-introspection
  gtk-doc
  libsysprof-capture
  meson
  python-dbusmock
  vala
)
provides=(
  libfolks.so
  libfolks-{dummy,eds}.so
)
options=(!lto)
_commit=1ae8ccc3e55bd1b840d9082de1a19e5a6b5ccf83  # tags/0.15.6^0
source=("git+https://gitlab.gnome.org/GNOME/folks.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd folks
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd folks
}

build() {
  local meson_options=(
    -D b_lto=false  # LTO copies some GType constructors
    -D docs=true
    -D profiling=true
    -D telepathy_backend=false
  )

  arch-meson folks build "${meson_options[@]}"
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs -t 4
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
